/*
 * QE3e Qt Quick 3D Engine.
 * Copyright (C) 2010 Joris Vaillant and Mathieu Pujol 
 * <joris.vaillant@gmail.com>  <mathieu.pujol87@gmail.com>
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

//qe3e
#include "ItemFxOccluder.h"
#include <Item.h>

//Qt
#include <QString>
#include <QVariant>

namespace qe3e
{
  ItemFxOccluder::ItemFxOccluder()
  {
  }

  ITEM_FX_ID ItemFxOccluder::getId() const
  {
    return 0x2;
  }

  void ItemFxOccluder::drawItem(const Item *item)
  {
    glMatrixMode(GL_MODELVIEW);
    glEnable(GL_DEPTH_TEST);
    //sauve la modelview
    glPushMatrix();

    //applique la matrice de transform
    float matrix[16];
    item->worldTransform().getFloatColumnMajorMatrix(matrix);
    glMultMatrixf(matrix);
    item->drawGeometry();

    //restaure la modelview
    glPopMatrix();
  }

  bool ItemFxOccluder::isHardwareSupported()
  {
    return true;
  }

  void ItemFxOccluder::setParameter(const QString &name, const QVariant &value)
  {
    Q_UNUSED(name);
    Q_UNUSED(value);
  }
}
